package cn.easybuy.servlet.Cart;

import cn.easybuy.entity.BuyCar;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

@WebServlet("/burCarSettleServlet")
public class BurCarSettleServlet  extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       //结算
        HttpSession session = req.getSession();
        List<BuyCar> list = (List<BuyCar> )session.getAttribute("listCarSession");
        if(list!=null){
            //操作数据
        }
        //跳转到结算页面
        req.getRequestDispatcher("pre/settlement/toSettlement.jsp").forward(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }
}
